r = 1 gotstake = 1 vampire = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 9) AS STRING directions(1) = "SOUTH" directions(2) = "NORTH OR EAST" directions(3) = "WEST OR EAST" directions(4) = "NORTH, SOUTH, OR WEST" directions(5) = "SOUTH" directions(6) = "NORTH OR WEST" directions(7) = "EAST OR SOUTH" directions(8) = "NORTH OR EAST" directions(9) = "WEST" PRINT "" PRINT "" PRINT "It has all come down to this. After months of tracking down the sick" PRINT "demented creature that had feasted upon your sisters flesh. The blood" PRINT "sucking filth that walks amongst the living at night will pay for it's" PRINT "crime." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " Night of the Vampire " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotstake = 1 THEN: PRINT "A handcrafted wooden stake." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 6 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 8 THEN: r = 7: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 6: GOTO moved IF r = 7 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 4 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 2: GOTO moved IF r = 6 THEN: r = 7: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF (cmd$ = "USE STAKE") THEN CLS PRINT "Best to save it for the blood drinking monster." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE VAMPIRE") AND r = 9 THEN CLS PRINT "It hangs from the rafters. A smug look upon it's face and what" PRINT "appears to be blood oozing out of it's mouth. It just feasted" PRINT "upon another victim. Pity." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE STAKE") AND gotstake = 1 THEN CLS PRINT "A handcrafted wooden stake, fashioned out of red oak, in the" PRINT "garage that you've converted into your base of operation." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE STAKE") AND gotstake = 1 AND r = 9 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "WAKE VAMPIRE") THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing at the entraceway towards the cities underworld." PRINT "A place where those who are homeless live during the winter months." RETURN r2: PRINT "Your footsteps echo with every step. You wonder if the foul beast" PRINT "will hear you?" RETURN r3: PRINT "The sound of water leaking from a pipe off into the darkness rings" PRINT "through the darkened catacombs of the city." RETURN r4: PRINT "Not a soul in place. Wonder if the new occupant already feasted" PRINT "upon them?" RETURN r5: PRINT "The foul stench of death and decay lingers around you like a cold" PRINT "embrace from a loving mother. Funny, how this foul creature is able" PRINT "to even exist in this world. Maybe it's for the best?" RETURN r6: PRINT "You notice the hundreds of rats running past your feet. Great, I must" PRINT "be getting close." RETURN r7: PRINT "In the distance you can hear the sounds of something snoring. Like" PRINT "a dog after it eats a heavy meal." RETURN r8: PRINT "The eerie glow of candles are seen in the distance. This is where it" PRINT "must sleept. You feel a wave of fear overcome you, but it quickly" PRINT "fades away. You know what you must do!" RETURN r9: PRINT "You see the fould creature. Hanging from the ceiling, the glow of" PRINT "the candles is almost blinding. This part of the tunnels, looks as" PRINT "if it's from another century. A building rage is overcoming you." RETURN win: COLOR 2, 0 CLS PRINT "You plunge the stake into the creatures heart. It quickly opens" PRINT "it's eye's and gives out a scream of death and pain. A smile washes" PRINT "over your face within a matter of seconds it shutters and turns" PRINT "to dust. Now those victims of this monster can finally found peace" PRINT "and rest." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "The Vampire grabs you by your shoulders and throws you to the ground." PRINT "Before you could even get up, it lunges upon you, and you are no more" PRINT "amongst the world of the living. You join your Sister in the afterlife." PRINT "Hoping and praying that someone else could rid the world of this curse." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "Day quickly turns to night and before you could send it back to the" PRINT "gates of hell. It flies past you to feast on another soul...pity." _DISPLAY END END SUB